/*
 * DxfARCALIGNEDTEXT.java
 *
 * Created on 6 de Dezembro de 2007, 10:55
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

import mathematics.Point3D;

/**
 *
 * @author rafaelbuck
 */
public class DxfARCALIGNEDTEXT extends DxfEntity
{

    public boolean setGroup(short grpNr, float fval)
    {
        switch(grpNr)
        {
        case 10: // '\n'
        case 20: // '\024'
        case 30: // '\036'
            setCoord(arcCenter, grpNr / 10, fval);
            return true;

        case 40: // '('
            arcRadius = fval;
            return true;

        case 41: // ')'
            aspectRatio = fval;
            return true;

        case 42: // '*'
            textHeight = fval;
            return true;

        case 43: // '+'
            characterSpacing = fval;
            return true;

        case 44: // ','
            arcOffset = fval;
            return true;

        case 45: // '-'
            leftOffset = fval;
            return true;

        case 46: // '.'
            rightOffset = fval;
            return true;

        case 50: // '2'
            arcStartAngle = fval;
            return true;

        case 51: // '3'
            arcEndAngle = fval;
            return true;
        }
        return super.setGroup(grpNr, fval);
    }

    public boolean setGroup(short grpNr, int ival)
    {
        switch(grpNr)
        {
        case 70: // 'F'
            characterOrderReversed = ival != 0;
            return true;

        case 71: // 'G'
            directionFlag = ival;
            return true;

        case 72: // 'H'
            alignmentFlag = ival;
            return true;

        case 73: // 'I'
            sideFlag = ival;
            return true;

        case 74: // 'J'
            boldFlag = ival;
            return true;

        case 75: // 'K'
            italicFlag = ival;
            return true;

        case 76: // 'L'
            underlineFlag = ival;
            return true;

        case 77: // 'M'
            characterSet = ival;
            return true;

        case 78: // 'N'
            pitchAndFamily = ival;
            return true;

        case 79: // 'O'
            fontType = ival;
            return true;

        case 90: // 'Z'
            colorIndex = ival;
            return true;

        case 280: 
            wizardFlag = ival;
            return true;
        }
        return super.setGroup(grpNr, ival);
    }

    public boolean setGroup(short grpNr, String str)
    {
        switch(grpNr)
        {
        case 1: // '\001'
            textContent = str;
            return true;

        case 2: // '\002'
            fontName = str;
            return true;

        case 3: // '\003'
            bigFontName = str;
            return true;

        case 7: // '\007'
            styleName = str;
            return true;

        case 330: 
            arcHandle = str;
            return true;
        }
        return super.setGroup(grpNr, str);
    }

    public String getTextContent()
    {
        return textContent;
    }

    public String getFontName()
    {
        return fontName;
    }

    public String getBigFontName()
    {
        return bigFontName;
    }

    public String getStyleName()
    {
        return styleName;
    }

    public Point3D getArcCenter()
    {
        return arcCenter;
    }

    public double getArcRadius()
    {
        return arcRadius;
    }

    public double getAspectRatio()
    {
        return aspectRatio;
    }

    public double getTextHeight()
    {
        return textHeight;
    }

    public double getCharacterSpacing()
    {
        return characterSpacing;
    }

    public double getArcOffset()
    {
        return arcOffset;
    }

    public double getRightOffset()
    {
        return rightOffset;
    }

    public double getLeftOffset()
    {
        return leftOffset;
    }

    public double getArcStartAngle()
    {
        return arcStartAngle;
    }

    public double getArcEndAngle()
    {
        return arcEndAngle;
    }

    public boolean isCharacterOrderReversed()
    {
        return characterOrderReversed;
    }

    public int getDirectionFlag()
    {
        return directionFlag;
    }

    public int getAlignmentFlag()
    {
        return alignmentFlag;
    }

    public int getSideFlag()
    {
        return sideFlag;
    }

    public int getBoldFlag()
    {
        return boldFlag;
    }

    public int getItalicFlag()
    {
        return italicFlag;
    }

    public int getUnderlineFlag()
    {
        return underlineFlag;
    }

    public int getCharacterSet()
    {
        return characterSet;
    }

    public int getPitchAndFamily()
    {
        return pitchAndFamily;
    }

    public int getFontType()
    {
        return fontType;
    }

    public int getColorIndex()
    {
        return colorIndex;
    }

    public int getWizardFlag()
    {
        return wizardFlag;
    }

    public String getArcHandle()
    {
        return arcHandle;
    }

    /** Creates a new instance of DxfARCALIGNEDTEXT */
    public DxfARCALIGNEDTEXT()
    {
        arcCenter = new Point3D();
        aspectRatio = 1.0D;
    }

    public static final int FONT_TYPE_TTF = 0;
    public static final int FONT_TYPE_SHX = 1;
    private String textContent;
    private String fontName;
    private String bigFontName;
    private String styleName;
    private Point3D arcCenter;
    private double arcRadius;
    private double aspectRatio;
    private double textHeight;
    private double characterSpacing;
    private double arcOffset;
    private double rightOffset;
    private double leftOffset;
    private double arcStartAngle;
    private double arcEndAngle;
    private boolean characterOrderReversed;
    private int directionFlag;
    private int alignmentFlag;
    private int sideFlag;
    private int boldFlag;
    private int italicFlag;
    private int underlineFlag;
    private int characterSet;
    private int pitchAndFamily;
    private int fontType;
    private int colorIndex;
    private int wizardFlag;
    private String arcHandle;
}